package com.ilxqx.framework.util;

import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.builder.ReflectionToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;

/**
 * 调试工具类
 * @author venus
 */
@Slf4j
public final class InfoUtils {

    /**
     * 将任意的对象转为字符串
     * @param object 对象
     * @return 字符串
     */
    public static String stringify(Object object) {
        return ReflectionToStringBuilder.toString(object, ToStringStyle.MULTI_LINE_STYLE);
    }

    /**
     * 将任意的对象转为字符串并且输出
     * @param object 对象
     */
    public static void print(Object object) {
        log.info(InfoUtils.stringify(object));
    }

}
